home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / fredfish / 1092.lha / Programs / ErrorMsg / Include / libraries / errormsg.i < prev   
Text File  |  1994-12-22  |  9KB  |  275 lines

  1.     IFND    LIBRARIES_ERRORMSG_I
  2. LIBRARIES_ERRORMSG_I    SET    1
  3. **
  4. **    $Filename: libraries/errormsg.i $
  5. **    $Revision: 4.01 $
  6. **
  7. **    errormsg.library definitions
  8. **
  9. **    (C) Copyright 1994 Frédéric Delacroix
  10. **    All Rights Reserved
  11. **
  12.  
  13.     IFND    EXEC_TYPES_I
  14.     include    exec/types.i
  15.     ENDC
  16.  
  17.     IFND    EXEC_LISTS_I
  18.     include    exec/lists.i
  19.     ENDC
  20.  
  21.     IFND    EXEC_LIBRARIES_I
  22.     include    exec/libraries.i
  23.     ENDC
  24.  
  25.     IFND    EXEC_SEMAPHORES_I
  26.     include    exec/semaphores.i
  27.     ENDC
  28.  
  29.     IFND    UTILITY_TAGITEM_I
  30.     include    utility/tagitem.i
  31.     ENDC
  32.  
  33.     STRUCTURE    ErrorMsgBase,LIB_SIZE
  34.     ULONG    emb_SegList    ; pointer to seglist (PRIVATE)
  35.  
  36. ; These remain valid as long as errormsg.library is open, they are readable
  37. ; by your application...
  38.     APTR    emb_DOSBase    ; pointer to DOSBase
  39.     APTR    emb_IntuitionBase    ; pointer to IntuitionBase
  40.     APTR    emb_LocaleBase    ; pointer to LocaleBase
  41.     APTR    emb_UtilityBase    ; pointer to UtilityBase
  42.     APTR    emb_RexxSysLibBase    ; pointer to RexxSysLibBase (or NULL if
  43.                     ; it couldn't be opened), new for V2.0
  44.     APTR    emb_ExecBase    ; pointer to ExecBase, new for V3.02
  45.  
  46. ; This is private (subject to changes):
  47.     APTR    emb_Locale
  48.     APTR    emb_Catalog
  49.     STRUCT    emb_FaultSemaphore,SS_SIZE
  50.     STRUCT    emb_FaultCache,MLH_SIZE
  51.     STRUCT    emb_FaultBuffer,100
  52.  
  53.     LABEL    emb_SIZEOF    ; This one is none of your business :-)
  54.  
  55. *************************************************************************
  56. * System ID values                            *
  57. *************************************************************************
  58. ; These IDs are to be passed as the "System" argument:
  59.  
  60. ERMSYS_INVALID    EQU    -1    ; internal use
  61. ERMSYS_DOS    EQU    0    ; messages from dos.library
  62. ERMSYS_EXEC    EQU    1    ; messages from exec.library
  63. ERMSYS_GRAPHICS    EQU    2    ; messages from graphics.library
  64. ERMSYS_INTUITION    EQU    3    ; messages from intuition.library
  65. ERMSYS_IFFPARSE    EQU    4    ; messages from iffparse.library
  66.  
  67. ERMSYS_AUDIO    EQU    5    ; messages from audio.device
  68. ERMSYS_GAMEPORT    EQU    6    ; messages from gameport.device
  69. ERMSYS_NARRATOR    EQU    7    ; messages from narrator.device
  70. ERMSYS_PARALLEL    EQU    8    ; messages from parallel.device
  71. ERMSYS_PRINTER    EQU    9    ; messages from printer.device
  72. ERMSYS_SCSIDISK    EQU    10    ; messages from scsidisk.device
  73. ERMSYS_SERIAL    EQU    11    ; messages from serial.device
  74. ERMSYS_TRACKDISK    EQU    12    ; messages from trackdisk.device
  75. ERMSYS_CLIPBOARD    EQU    13    ; etc...
  76. ERMSYS_CONSOLE    EQU    14
  77. ERMSYS_INPUT    EQU    15
  78. ERMSYS_KEYBOARD    EQU    16
  79. ERMSYS_TIMER    EQU    17
  80.  
  81. ERMSYS_AMIGAGUIDE    EQU    18
  82. ERMSYS_ARP    EQU    19
  83. ERMSYS_COMMODITIES    EQU    20
  84. ERMSYS_ERRORMSG    EQU    21    ; yes, we can diagnostic our own errors
  85. ERMSYS_EXPANSION    EQU    22
  86. ERMSYS_GADTOOLS    EQU    23
  87. ERMSYS_POWERPACKER    EQU    24
  88. ERMSYS_TRANSLATOR    EQU    25
  89. ERMSYS_DATATYPES    EQU    26
  90. ERMSYS_DISKFONT    EQU    27
  91.  
  92. ; new for V3:
  93. ERMSYS_MUI    EQU    28
  94.  
  95. ; new for V3.04:
  96. ERMSYS_XFD    EQU    29
  97.  
  98. ; new for V4.00:
  99. ERMSYS_GADTOOLSBOX    EQU    30
  100.  
  101. ; new for V4.01:
  102. ERMSYS_GUIFRONT    EQU    31
  103. ERMSYS_XPK    EQU    32
  104.  
  105. ERMSYS_LAST    EQU    ERMSYS_XPK    ; (for now!)
  106.  
  107. *************************************************************************
  108. * Subsystem ID values                            *
  109. *************************************************************************
  110. ; These values were chosen so that they look significant: they are equal
  111. ; to _LVO offsets for libraries, and CMD_ for devices... It's probably
  112. ; just as good to implement them as that in your program... A warning
  113. ; however: some _LVO are not recognized (for example, ERMSUB_MatchFirst
  114. ; is the same value as ERMSUB_IoErr), some are recognized as a special
  115. ; case (like ERMSYS_MUI/ERMSUB_MUIAutoError).
  116.  
  117. ; Another note: they may be ignored for some systems...
  118. ERMSUB_Generic    EQU    0    ; This is for systems that do not support
  119.     ; specific subsystem values. Providing this will protect you from
  120.     ; future changes...
  121.  
  122. ; Values for ERMSYS_DOS:
  123. ; Special note: passing 0 as the error code when using ERMSYS_DOS/
  124. ; ERMSUB_IoErr will tell errormsg.library to get the error from IoErr()
  125. ; itself.
  126.  
  127. ERMSUB_IoErr    EQU    -132        ; internally implemented as a cached
  128. ERMSUB_MatchFirst    EQU    ERMSUB_IoErr    ; call to Fault()
  129. ERMSUB_MatchNext    EQU    ERMSUB_IoErr    ; (value is _LVOIoErr)
  130. ERMSUB_Fault    EQU    ERMSUB_IoErr
  131.  
  132. MIN_DOS_ERROR    EQU    100    ; Only these codes are supported,
  133. MAX_DOS_ERROR    EQU    310    ; to prevent "Error code ..." to be stored
  134.                 ; in memory hundreds of times
  135.  
  136.  
  137. ; Values for ERMSYS_EXEC:
  138. ; for this value, you may pass the memory requirements (MEMF_...) as the
  139. ; error code for a more precise message, or 0 for a standard out of mem.
  140. ; ex: GetErrorMsg(ERMSYS_EXEC,ERMSUB_NoMemory,MEMF_CHIP!MEMF_CLEAR) will
  141. ; return "Not enough CHIP memory"
  142. ERMSUB_NoMemory    EQU    -198    ; (equals _LVOAllocMem)
  143.  
  144. ; This value is new for V3.02. With ERMSYS_EXEC/ERMSUB_NoLibrary, you can
  145. ; alert the user when a library has failed to open. The Code parameter is
  146. ; a bit special then: it is a flag mask. By setting bits in this mask, you
  147. ; tell errormsg.library you wish to have a message with arguments (the library
  148. ; name and version) in it. See below for supported value, and for
  149. ; DisplayErrorMsgA() additionnal tag handling.
  150. ; This value can of course also be used for opening devices and resources.
  151. ; (You should not provide a version number for resources)
  152. ERMSUB_NoLibrary    EQU    -552    ; (equals _LVOOpenLibrary)
  153.  
  154.  
  155. ; Values for ERMSYS_GRAPHICS:
  156. ; note: these two are only usable as of V39 of the OS (Release 3.0)
  157. ERMSUB_MakeVPort    EQU    -216    ; (equals _LVOMakeVPort)
  158. ERMSUB_MrgCop    EQU    -210    ; (_LVOMrgCop)
  159.  
  160.  
  161. ; Values for ERMSYS_INTUITION:
  162. ; note: returned through the SA_ErrorCode TagItem
  163. ERMSUB_OpenScreen    EQU    -198    ; (_LVOOpenScreen)
  164. ERMSUB_OpenScreenTagList    EQU    ERMSUB_OpenScreen
  165.  
  166.  
  167. ; Values for ERMSYS_COMMODITIES:
  168. ERMSUB_CxBroker    EQU    -36    ; (_LVOCxBroker)
  169. ERMSUB_CxObjError    EQU    -66    ; _LVOCxObjError
  170.  
  171.  
  172. ; New for V3: this subsystem ID is valid only for ERMSYS_MUI, providing it
  173. ; to GetErrorMsgA() and providing a pointer to the base of muimaster.library
  174. ; instead of a code in D0 will tell errormsg.library to call MUI_Error
  175. ; automagically. This base must be valid ! errormsg.library currently checks
  176. ; if the LN_NAME field points to the good name, but don't count on it as it
  177. ; can (and will if the library base is incorrect) cause (luckily harmless)
  178. ; Enforcer hits.
  179. ; If you provide the error code yourself, use ERMSUB_Generic instead.
  180.  
  181. ERMSUB_MUIAutoError    EQU    -66    ; (_LVOMUI_Error)
  182.  
  183.  
  184. ; New for V4.00, values defined for ERMSYS_GADTOOLSBOX:
  185.  
  186. ; Use this one for errors returned by GTX_LoadGUIA()
  187. ERMSUB_LoadGUI    EQU    -264        ; (_LVOGTX_LoadGUIA)
  188.  
  189. ; This one is used to identify errors returned by the function
  190. ; SetupScreen() in the generated source:
  191. ERMSUB_SetupScreen    EQU    1
  192.  
  193. ; And this one for errors issued by the functions OpenxxxWindow():
  194. ERMSUB_OpenAWindow    EQU    2
  195.  
  196.  
  197. ; Values for ERMSYS_GUIFRONT, new for V4.01:
  198.  
  199. ; This is for error codes returned by GF_CreateGUIA() via the
  200. ; GUI_ExtendedError tag.
  201. ERMSUB_CreateGUIA    EQU    -60    ; (_LVOGF_CreateGUIA)
  202.  
  203.  
  204. ; No values are defined for the other systems yet, just provide
  205. ; ERMSUB_Generic as the subsystem code. Note: the narrator.device does not
  206. ; use the standard error codes that are defined in exec/errors.i
  207.  
  208.  
  209. ****************************************************************************
  210. * Errors that may be returned by errormsg.library itself (returned through *
  211. * the EMT_Error tag):                                                      *
  212. ****************************************************************************
  213. ERMERR_Unsupported_System    EQU    1
  214. ERMERR_Unsupported_SubSystem    EQU    2
  215. ERMERR_Unknown_Code    EQU    3
  216. ERMERR_NoMemory    EQU    4
  217.  
  218.  
  219. ****************************************************************************
  220. * Some flags                                                               *
  221. ****************************************************************************
  222. ; Tell GetErrorMsgA() (and thus DisplayErrorMsgA() too) to return a message
  223. ; with a place (%s) for the library name when ERMSYS_EXEC/ERMSUB_NoLibrary
  224. ; is used (the code argument is then a mask made of these flags).
  225.     BITDEF    EXEC,NOLIB_USENAME,0
  226.  
  227. ; Tell errormsg.library to return a message with a place (%ld) for the
  228. ; library version number when ERMSYS_EXEC/ERMSUB_NoLibrary is used. Secify
  229. ; only together with EXECF_NOLIB_USENAME (in the code argument too).
  230.     BITDEF    EXEC,NOLIB_USEVERSION,1
  231.  
  232. ; Like it says !
  233.     BITDEF    EXEC,NOLIB_PRIVATE1,31
  234.  
  235.  
  236. ****************************************************************************
  237. * Tag values                                                               *
  238. ****************************************************************************
  239. EMT_Dummy    EQU    TAG_USER
  240.  
  241. ; Tag Values for GetErrorMsgA():
  242.  
  243. EMT_Error    EQU    EMT_Dummy+1
  244. EMT_Length    EQU    EMT_Dummy+2
  245. EMT_ForceCopy    EQU    EMT_Dummy+4
  246.  
  247. ; Tag values for DisplayMsgA():
  248.  
  249. EMT_Window    EQU    EMT_Dummy+20
  250. EMT_Title    EQU    EMT_Dummy+21
  251. EMT_GadFmt    EQU    EMT_Dummy+22
  252. EMT_IDCMPPtr    EQU    EMT_Dummy+23
  253.  
  254. ; new for V3.01: DisplayMessageA() (so DisplayErrorMsgA() too) can use
  255. ; MUI_RequestA() instead of EasyRequestArgs(). See autodocs for details.
  256. EMT_MUIBase    EQU    EMT_Dummy+24
  257. EMT_MUIAppObject    EQU    EMT_Dummy+25
  258. EMT_MUIWinObject    EQU    EMT_Dummy+26
  259.  
  260. ; new tags for DisplayErrorMsgA() in V3.02.
  261. ; these tag are only checked for ERMSYS_EXEC/ERMSUB_NoLibrary sys/subsystem
  262. ; pair, and only when using DisplayErrorMsgA(). If you use GetErrorMsgA()
  263. ; and then DisplayMessageA(), you must provide these arguments by hand. The
  264. ; tags are quite self-explanatory, they are described in the DisplayErrorMsgA()
  265. ; autodoc.
  266. EMT_LibName    EQU    EMT_Dummy+40
  267. EMT_LibVersion    EQU    EMT_Dummy+41
  268.  
  269. ****************************************************************************
  270. ERRORMSGNAME    MACRO
  271.     dc.b    'errormsg.library',0    ;beware ! lower-case !
  272.     ENDM
  273.  
  274.     ENDC    ; ERRORMSG_I
  275.